package com.junzhiit.nengji.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum RechargeConfigureGiveType {
	MONEY(1,"金额"),
	OTHER(0,"其他");
	
	private Integer type;
	
	private String value;
	
	private RechargeConfigureGiveType(Integer type,String value){
		this.type = type;
		this.value = value;
	}

	public int toIntType() {
		return this.type;
	}
	
	public String toStringValue() {
		return this.value;
	}
	
	public static RechargeConfigureGiveType toType(int type) {
		if (MONEY.type == type) {
			return MONEY;
		} else if (OTHER.type == type) {
			return OTHER;
		}  else {
			throw new InvalidArgumentException("Unknown type[" + type + "].");
		}
	}
}
